<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>资源监控</title>
<%@ include file="/WEB-INF/include/include.jsp"%>
<script type="text/javascript"
	src="<%=path%>/js/rms/resourcesMonitor/resourcesMonitor.js"></script>

</head>
<body>
	<div >
		<div class="listpage-grid" id="formWrap"></div>
		<div class="listpage-grid" id="gridWrap"></div>
		<div class="listpage-lk-tbar" id="tbarWrap2"></div>
		<div class="listpage-grid" id="vmgridWrap"></div>
	</div>

</body>
</html>

<ui:page>

	<ui:model name="GrildVappModel">
		<x:attr name="fields" type="array">

			<ui:model.field name="VAPP_VDC"></ui:model.field>
			<ui:model.field name="VAPP_NAME"></ui:model.field>
			<ui:model.field name="VAPP_DESCRIBE"></ui:model.field>
			<ui:model.field name="VAPP_STATUS"></ui:model.field>
			<ui:model.field name="VAPP_VM"></ui:model.field>

			<ui:model.field name="VAPP_OWNER"></ui:model.field>
			<ui:model.field name="VAPP_CPU"></ui:model.field>
			<ui:model.field name="VAPP_MEMORY"></ui:model.field>
			<ui:model.field name="VAPP_SIZE"></ui:model.field>
			<ui:model.field name="vmList"></ui:model.field>
		</x:attr>
	</ui:model>


	<ui:panel width="300" renderTo="formWrap">
		<x:attr name="padding" type="string">2</x:attr>

		<x:attr name="layout">column</x:attr>
		<x:attr name="border" type="int">0</x:attr>

		<x:attr name="items" type="array">
			<ui:formPanel.comboxserver displayField="VDC_Desc" id="comboVDC"
				fields="['VDC_Name','VDC_Desc','vappsList']" fieldLabel="云数据中心名称"
				handlerName="ResourcesMonitorQueryHandler" valueField="VDC_Name"
				handlerMethod="handler" datasetName="ResourcesMonitorQueryHandler">
				<x:listeners>
					<x:handler name="select" funcName="resMgrList.loadVapp"></x:handler>
				</x:listeners>
			</ui:formPanel.comboxserver>

		</x:attr>
	</ui:panel>

	<ui:grid id="vappGrid" showCheckbox="false" autoLoad="false" height="250" 
		datasetName="ResourcesMonitorDatasetHandler"
		handlerName="ResourcesMonitorQueryHandler" model="GrildVappModel"
		renderTo="gridWrap">
		<x:columns>

			<ui:gridcolumn text="云中心名称" dataIndex="VAPP_VDC" />
			<ui:gridcolumn text="名称" dataIndex="VAPP_NAME" />
			<ui:gridcolumn text="描述" dataIndex="VAPP_DESCRIBE" />
			<ui:gridcolumn text="状态" dataIndex="VAPP_STATUS"
				renderer="resMgrList.statusRender" />
			<ui:gridcolumn text="主机" dataIndex="VAPP_VM"></ui:gridcolumn>
			<ui:gridcolumn text="所有者 " dataIndex="VAPP_OWNER" />
			<ui:gridcolumn text="处理器" dataIndex="VAPP_CPU" />
			<ui:gridcolumn text="内存 " dataIndex="VAPP_MEMORY" />
			<ui:gridcolumn text="存储(已使用)" dataIndex="VAPP_SIZE" />
		</x:columns>
		<x:listeners>
			<x:handler name="itemclick" funcName="resMgrList.loadVM"></x:handler>
		</x:listeners>

	</ui:grid>

	<ui:model name="GridVMModel">
		<x:attr name="fields" type="array">
			<ui:model.field name="VM_ID"></ui:model.field>
			<ui:model.field name="VDC_Name"></ui:model.field>
			<ui:model.field name="VApp_Name"></ui:model.field>
			<ui:model.field name="VM_Name"></ui:model.field>
			<ui:model.field name="VM_Status"></ui:model.field>
			<ui:model.field name="VM_Cpu"></ui:model.field>
			<ui:model.field name="VM_Memory"></ui:model.field>
			<ui:model.field name="VM_HardDisk"></ui:model.field>
		</x:attr>
	</ui:model>
	<ui:b_toolbar menuCode="resMonitor" id="toolbar" renderTo="tbarWrap2" />
	<ui:grid id="VMGrid" showCheckbox="false" autoLoad="false" height="250"
		datasetName="VMMgrDatasetHandler" handlerName="VMMgrQueryHandler"
		model="GridVMModel" renderTo="vmgridWrap">
		<x:columns>
			<ui:gridcolumn dataIndex="VM_ID" hidden="true"></ui:gridcolumn>
			<ui:gridcolumn text="云中心名称" dataIndex="VDC_Name" />
			<ui:gridcolumn text="Vapp名称" dataIndex="VApp_Name" />
			<ui:gridcolumn text="主机名称" dataIndex="VM_Name" />
			<ui:gridcolumn text="状态" dataIndex="VM_Status"
				renderer="resMgrList.statusRender" />
			<ui:gridcolumn text="CPU" dataIndex="VM_Cpu" />
			<ui:gridcolumn text="内存" dataIndex="VM_Memory" />
			<ui:gridcolumn text="硬盘大小" dataIndex="VM_HardDisk" />
		</x:columns>
		<x:listeners>
			<x:handler name="itemdblclick" funcName="resMgrList.vmMonitor"></x:handler>
		</x:listeners>
	</ui:grid>

</ui:page>


